// 哪个路由组件中 如果引入了typenav组件的话 当前路由组件一定要配name
export default [
    {
        name:"home",
        path:"/home",
        component:()=> import(/* webpackChunkName: "sph-home" */ "pages/home/home")
    },
    {
        name:"login",
        path:"/login",
        component:()=> import(/* webpackChunkName: "sph-login" */ "pages/login/login"),
        meta:{hideFooter:true}
    },
    {
        name:"register",
        path:"/register",
        component:()=> import(/* webpackChunkName: "sph-register" */ "pages/register/register"),
        meta:{hideFooter:true}
    },
    {
        name:"search",
        path:"/search/:keyword?",
        component:()=> import(/* webpackChunkName: "sph-search" */ "pages/search/search"),
        props:route=>({
            keyword:route.params.keyword,
            categoryName:route.query.categoryName,
            category1Id:route.query.category1Id,
            category2Id:route.query.category2Id,
            category3Id:route.query.category3Id
        })
    },
    {
        name:"shopcart",
        path:"/shopcart",
        component:()=> import(/* webpackChunkName: "sph-shopcart" */ "pages/shopcart/shopcart")
    },
    {
        name:"detail",
        path: "/detail/:id",
        component: () => import(/* webpackChunkName: "sph-detail" */ "pages/detail/detail"),
        props:true,
        children:[
            {path:"",redirect:"info"},
            {name:"detail-rule",path:"rule",component: () => import(/* webpackChunkName: "sph-rule" */ "pages/detail/pages/rule/rule")},
            {name:"detail-rating",path:"rating",component: () => import(/* webpackChunkName: "sph-rating" */ "pages/detail/pages/rating/rating")},
            {name:"detail-info",path:"info",component: () => import(/* webpackChunkName: "sph-info" */ "pages/detail/pages/info/info")},
            {name:"detail-home",path:"home",component: () => import(/* webpackChunkName: "sph-home" */ "pages/detail/pages/home/home")},
            {name:"detail-afterSale",path:"afterSale",component: () => import(/* webpackChunkName: "sph-afterSale" */ "pages/detail/pages/afterSale/afterSale")},
        ]
    },
    {
      name:"addCartSuccess",
      path:"/addCartSuccess",
      component:()=>import(/* webpackChunkName: "sph-addCartSuccess" */ "pages/addCartSuccess/addCartSuccess"),
      props:route=>({skuNum:route.query.skuNum})
    },
    {
        name:"center",
        path:"/center",
        component:()=>import(/* webpackChunkName: "sph-center" */ "pages/center/center"),
        children: [
            {
                name:"center-myOrder",
                path:"myOrder",
                component:()=>import(/* webpackChunkName: "sph-myOrder" */
                    "pages/center/pages/myOrder/myOrder"),},
            {
                name:"center-userInfo",
                path:"userInfo",
                component:()=>import(/* webpackChunkName: "sph-userInfo" */
                    "pages/center/pages/userInfo/userInfo"),},
            {path:"", redirect: "userInfo"}
        ]
    },
    {
        name:"pay",
        path:"/pay",
        component:()=>import(/* webpackChunkName: "sph-pay" */ "pages/pay/pay"),
        props:route=>({orderId:route.query.orderId})
    },
    {
        name:"paySuccess",
        path:"/paySuccess",
        component:()=>import(/* webpackChunkName: "sph-paySuccess" */ "pages/paySuccess/paySuccess"),
    },
    {
        name:"trade",
        path:"/trade",
        component:()=>import(/* webpackChunkName: "sph-trade" */ "pages/trade/trade"),
    },
    //配404
    {
        name:"404",
        path:"*",
        component:()=> import(/* webpackChunkName: "sph-shopcart" */ "pages/notFind/index")
    },
    {
        path:"/",
        redirect:"/home"
    }
]